Skip to content

feat(mcp): add SSE transport support for MCP client (salvage #19135)#21227

Merged
teknium1 merged 1 commit into
mainfrom
salvage/pr-19135
May 7, 2026
Merged

feat(mcp): add SSE transport support for MCP client (salvage #19135)#21227
teknium1 merged 1 commit into
mainfrom
salvage/pr-19135

Conversation

@teknium1
Copy link
Copy Markdown
Contributor

@teknium1 teknium1 commented May 7, 2026

Closes #19135 via salvage.

Summary

_run_http() previously forced StreamableHTTPTransport for all URL-based MCP servers; servers using SSE transport (GET /sse + POST /messages/) hung for connect_timeout. Adds transport: sse opt-in in mcp_servers: config, imports mcp.client.sse.sse_client with graceful fallback if the installed mcp package is too old. get_mcp_status() also now reports the actual transport instead of hardcoding http.

Validation

scripts/run_tests.sh tests/tools/test_mcp_tool.py → 182 passed.
Verified mcp.client.sse.sse_client imports in the current venv.

Original author: @andrewhosf.

Add support for MCP servers using the SSE transport protocol
(SseServerTransport) alongside the existing Streamable HTTP and stdio
transports. Many MCP servers use SSE (GET /sse + POST /messages/)
which was previously unsupported -- the client silently fell back to
Streamable HTTP, causing 10s connection timeouts.

Changes:
- Import mcp.client.sse.sse_client with graceful fallback
- Check config.get('transport') == 'sse' in _run_http() to select
  the SSE transport path with proper timeout handling
- Read transport type from config in get_mcp_status() instead of
  hardcoding 'http' for URL-based servers
- Update docstring, example config, and feature list
@teknium1 teknium1 merged commit 12289c2 into main May 7, 2026
10 of 11 checks passed
@teknium1 teknium1 deleted the salvage/pr-19135 branch May 7, 2026 12:36
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

🔎 Lint report: salvage/pr-19135 vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 7504 on HEAD, 7504 on base (➖ 0)

🆕 New issues (1):

Rule Count
unresolved-import 1
First entries
tools/mcp_tool.py:201: [unresolved-import] unresolved-import: Cannot resolve imported module `mcp.client.sse`

✅ Fixed issues (1):

Rule Count
invalid-assignment 1
First entries
tools/mcp_tool.py:2978: [invalid-assignment] invalid-assignment: Invalid subscript assignment with key of type `Literal["sampling"]` and value of type `dict[str, int]` on object of type `dict[str, str | int]`

Unchanged: 3941 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Medium — degraded but workaround exists tool/mcp MCP client and OAuth type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants